# @configure_input@ -*- Makefile -*-
#
# ${R_HOME}/etc/Makeconf
#
# R was configured using the following call
# (not including env. vars and site configuration)
# configure @R_CONFIG_ARGS@

## This fails if it contains spaces, or if it is quoted
include $(R_SHARE_DIR)/make/vars.mk

AR = @AR@
BLAS_LIBS = @BLAS_LIBS@

## C compilers
CC = @CC@
CFLAGS = @CFLAGS@ $(LTO)
CC17 = @CC17@
C17FLAGS = @C17FLAGS@ $(LTO)
CC23 = @CC23@
C23FLAGS = @C23FLAGS@ $(LTO)
CC90 = @CC90@
C90FLAGS = @C90FLAGS@ $(LTO)
CC99 = @CC99@
C99FLAGS = @C99FLAGS@ $(LTO)
CPICFLAGS = @CPICFLAGS@
CPPFLAGS = @CPPFLAGS@
C_VISIBILITY = @C_VISIBILITY@

## C++ compilers
CXX = @CXX@ @CXXSTD@
CXXFLAGS = @CXXFLAGS@ $(LTO)
CXXPICFLAGS = @CXXPICFLAGS@
CXX11 = @CXX11@
CXX11FLAGS = @CXX11FLAGS@ $(LTO)
CXX11PICFLAGS = @CXX11PICFLAGS@
CXX11STD = @CXX11STD@
CXX14 = @CXX14@
CXX14FLAGS = @CXX14FLAGS@ $(LTO)
CXX14PICFLAGS = @CXX14PICFLAGS@
CXX14STD = @CXX14STD@
CXX17 = @CXX17@
CXX17FLAGS = @CXX17FLAGS@ $(LTO)
CXX17PICFLAGS = @CXX17PICFLAGS@
CXX17STD = @CXX17STD@
CXX20 = @CXX20@
CXX20FLAGS = @CXX20FLAGS@ $(LTO)
CXX20PICFLAGS = @CXX20PICFLAGS@
CXX20STD = @CXX20STD@
CXX23 = @CXX23@
CXX23FLAGS = @CXX23FLAGS@ $(LTO)
CXX23PICFLAGS = @CXX23PICFLAGS@
CXX23STD = @CXX23STD@
CXX26 = @CXX26@
CXX26FLAGS = @CXX26FLAGS@ $(LTO)
CXX26PICFLAGS = @CXX26PICFLAGS@
CXX26STD = @CXX26STD@
CXX_VISIBILITY = @CXX_VISIBILITY@

DYLIB_EXT = @DYLIB_EXT@
DYLIB_LD = @DYLIB_LD@
DYLIB_LDFLAGS = @DYLIB_LDFLAGS@@BUILD_LTO_TRUE@ $(CFLAGS) $(CPICFLAGS) @LTO_LD@
## should be used by packages for dylibs, but at the time of writing was not
DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS)
ECHO = echo
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@

## Fortran
FC = @FC@
FCFLAGS = @FCFLAGS@ $(LTO_FC)
## additional libs needed when linking with $(FC), e.g. on some Oracle compilers
FCLIBS_XTRA = @FCLIBS_XTRA@
FFLAGS = @FFLAGS@ $(LTO_FC)
FLIBS = @FLIBS_IN_SO@
FPICFLAGS = @FPICFLAGS@
FPIEFLAGS = @FPIEFLAGS@
F_VISIBILITY = @F_VISIBILITY@

FOUNDATION_CPPFLAGS = @FOUNDATION_CPPFLAGS@
FOUNDATION_LIBS = @FOUNDATION_LIBS@
JAR = @JAR@
JAVA = @JAVA@
JAVAC = @JAVAC@
JAVAH = @JAVAH@
## JAVA_HOME might be used in the next three.  
## They are for packages 'JavaGD' and 'rJava'
JAVA_HOME = @JAVA_HOME@
JAVA_CPPFLAGS = @JAVA_CPPFLAGS0@
JAVA_LIBS = @JAVA_LIBS0@
JAVA_LD_LIBRARY_PATH = @JAVA_LD_LIBRARY_PATH@
LAPACK_LIBS = @LAPACK_LIBS@
LDFLAGS = @LDFLAGS@
## We only need this is if it is external and not libc, as otherwise link to R
## Oo macOS, where libintl is static and so compiled in, can still link to R
LIBINTL = @LIBINTL_PKGS@
LIBM = @LIBM@
LIBR0 = @LIBR0@
LIBR1 = @LIBR1@
LIBR = @LIBR0@ @LIBR1@
LIBS = @LIBS_PKGS@
## needed by R CMD config
LIBnn = @LIBnn@
LIBTOOL = $(SHELL) "$(R_HOME)/bin/libtool"
## set for --enable-lto, --enable-lto=check
LTO = @LTOALL@
LTO_FC = @LTOALL_FC@
LTO_LD = @LTO_LD@
## set for --enable-lto=R, used in INSTALL
LTO_OPT = @LTO@
LTO_FC_OPT = @LTO_FC@
## needed to build applications linking to static libR
MAIN_LD = @MAIN_LD@
MAIN_LDFLAGS = @MAIN_LDFLAGS@
MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS)
MKINSTALLDIRS = "$(R_HOME)/bin/mkinstalldirs"
NM = @NM@
OBJC = @OBJC@
OBJCFLAGS = @OBJCFLAGS@ $(LTO)
OBJC_LIBS = @OBJC_LIBS@
OBJCXX = @OBJCXX@
R_ARCH = @R_ARCH@
RANLIB = @RANLIB@
SAFE_FFLAGS = @SAFE_FFLAGS@
## A version of SHLIB_LIBADD not overridden in install.R.
SAN_LIBS =
SED = @SED@
SHELL = @R_SHELL@
SHLIB_CFLAGS = @SHLIB_CFLAGS@
SHLIB_CXXFLAGS = @SHLIB_CXXFLAGS@
SHLIB_CXXLD = @SHLIB_CXXLD@
SHLIB_CXXLDFLAGS = @SHLIB_CXXLDFLAGS@@BUILD_LTO_ALL_TRUE@ $(CXXFLAGS) $(CXXPICFLAGS) $(LTO_LD)
SHLIB_CXX11LD = @SHLIB_CXX11LD@
SHLIB_CXX11LDFLAGS = @SHLIB_CXX11LDFLAGS@@BUILD_LTO_ALL_TRUE@ $(CXX11FLAGS) $(CXX11PICFLAGS) $(LTO_LD)
SHLIB_CXX14LD = @SHLIB_CXX14LD@
SHLIB_CXX14LDFLAGS = @SHLIB_CXX14LDFLAGS@@BUILD_LTO_ALL_TRUE@ $(CXX14FLAGS) $(CXX14PICFLAGS) $(LTO_LD)
SHLIB_CXX17LD = @SHLIB_CXX17LD@
SHLIB_CXX17LDFLAGS = @SHLIB_CXX17LDFLAGS@@BUILD_LTO_ALL_TRUE@ $(CXX17FLAGS) $(CXX17PICFLAGS) $(LTO_LD)
SHLIB_CXX20LD = @SHLIB_CXX20LD@
SHLIB_CXX20LDFLAGS = @SHLIB_CXX20LDFLAGS@@BUILD_LTO_ALL_TRUE@ $(CXX20FLAGS) $(CXX20PICFLAGS) $(LTO_LD)
SHLIB_CXX23LD = @SHLIB_CXX23LD@
SHLIB_CXX23LDFLAGS = @SHLIB_CXX23LDFLAGS@@BUILD_LTO_ALL_TRUE@ $(CXX23FLAGS) $(CXX23PICFLAGS) $(LTO_LD)
SHLIB_CXX26LD = @SHLIB_CXX26LD@
SHLIB_CXX26LDFLAGS = @SHLIB_CXX26LDFLAGS@@BUILD_LTO_ALL_TRUE@ $(CXX26FLAGS) $(CXX26PICFLAGS) $(LTO_LD)
SHLIB_EXT = @SHLIB_EXT@
SHLIB_FCLD = @SHLIB_FCLD@
SHLIB_FCLDFLAGS = @SHLIB_FCLDFLAGS@@BUILD_LTO_ALL_TRUE@ $(FCFLAGS) $(FPICFLAGS)
SHLIB_FFLAGS = @SHLIB_FFLAGS@
SHLIB_LD = @SHLIB_LD@
## used for add-on packages linked by C
SHLIB_LDFLAGS = @SHLIB_LDFLAGS@@BUILD_LTO_ALL_TRUE@ $(CFLAGS) $(CPICFLAGS) $(LTO_LD)
## used for standard packages
SHLIB_LDFLAGS_R = @SHLIB_LDFLAGS@@BUILD_LTO_TRUE@ $(CFLAGS) $(CPICFLAGS) $(LTO_LD)
## used in install.R to add OBJC_LIBS, FLIBS ....
SHLIB_LIBADD = @SHLIB_LIBADD@
## We want to ensure libR is picked up from $(R_HOME)/lib
## before e.g. /usr/local/lib if a version is already installed.
SHLIB_LINK = $(SHLIB_LD) $(SHLIB_LDFLAGS) $(LIBR0) $(LDFLAGS)
SHLIB_OPENMP_CFLAGS = @SHLIB_OPENMP_CFLAGS@
SHLIB_OPENMP_CXXFLAGS = @SHLIB_OPENMP_CXXFLAGS@
SHLIB_OPENMP_FFLAGS = @SHLIB_OPENMP_FFLAGS@
STRIP_STATIC_LIB = @STRIP_STATIC_LIB@
STRIP_SHARED_LIB = @STRIP_SHARED_LIB@
TCLTK_CPPFLAGS = @TCLTK_CPPFLAGS@
TCLTK_LIBS = @TCLTK_LIBS@
YACC = @YACC@

## for linking to libR.a
STATIC_LIBR = @WANT_R_STATIC_TRUE@ @STATICR1@ "$(R_HOME)/lib$(R_ARCH)/libR.a" @STATICR2@ $(BLAS_LIBS) $(FLIBS) @R_XTRA_LIBS@ $(LIBINTL) @READLINE_LIBS@ $(LIBS)

## These are recorded as macros for legacy use in packages
## set on AIX, formerly for old glibc (-D__NO_MATH_INLINES)
R_XTRA_CFLAGS = @R_XTRA_CFLAGS@
## @R_XTRA_CPPFLAGS@ was formerly set on HP-UX
R_XTRA_CPPFLAGS = @R_XTRA_CPPFLAGS@ @R_INCLUDES@ -DNDEBUG
## currently unset
R_XTRA_CXXFLAGS = @R_XTRA_CXXFLAGS@
## used for gfortran >= 7 in R 3.6.1 - 4.2.x
R_XTRA_FFLAGS = @R_XTRA_FFLAGS@

## SHLIB_CFLAGS SHLIB_CXXFLAGS SHLIB_FFLAGS are apparently currently unused
## SHLIB_CXXFLAGS is undocumented, there is no SHLIB_FCFLAGS
ALL_CFLAGS = @R_XTRA_CFLAGS@ $(PKG_CFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(CFLAGS)
## XDEFS was a temporary measure for use by R CMD INSTALL
ALL_CPPFLAGS = @R_XTRA_CPPFLAGS@ @R_INCLUDES@ -DNDEBUG $(PKG_CPPFLAGS) $(CLINK_CPPFLAGS) $(CPPFLAGS) @R_DEFS@ $(XDEFS)
## CXX_DEFS allows adding defines only for C++, e.g. -DR_NO_REMAP
ALL_CXXFLAGS = @R_XTRA_CXXFLAGS@ $(PKG_CXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(CXXFLAGS) $(CXX_DEFS)
ALL_OBJCFLAGS = $(PKG_OBJCFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(OBJCFLAGS)
ALL_OBJCXXFLAGS = $(PKG_OBJCXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(OBJCXXFLAGS)
ALL_FFLAGS = @R_XTRA_FFLAGS@ $(PKG_FFLAGS) $(FPICFLAGS) $(SHLIB_FFLAGS) $(FFLAGS)
## can be overridden by R CMD SHLIB
P_FCFLAGS = $(PKG_FFLAGS)
ALL_FCFLAGS = @R_XTRA_FFLAGS@ $(P_FCFLAGS) $(FPICFLAGS) $(SHLIB_FFLAGS) $(FCFLAGS)
## LIBR here as a couple of packages use this without SHLIB_LINK
ALL_LIBS = $(PKG_LIBS) $(SHLIB_LIBADD) $(SAN_LIBS) $(LIBR)@DYLIB_UNDEFINED_ALLOWED_FALSE@ $(LIBINTL)

.SUFFIXES:
.SUFFIXES: .c .cc .cpp .d .f .f90 .f95 .m .mm .M .o

@r_cc_rules_frag@
@r_cxx_rules_frag@
@r_objc_rules_frag@
.mm.o:
	$(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $@
.M.o:
	$(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $@
.f.o:
	$(FC) $(ALL_FFLAGS) -c $< -o $@
.f95.o:
	$(FC) $(ALL_FCFLAGS) -c @FCFLAGS_f95@ $< -o $@
.f90.o:
	$(FC) $(ALL_FCFLAGS) -c @FCFLAGS_f90@ $< -o $@
